export const useInsertSort = (users, newUser) => {
  // 二分查找插入位置
  let low = 0, high = users.length;
  while (low < high) {
    const mid = (low + high) >>> 1;
    if (users[mid].last_chat_time > newUser.last_chat_time) {
      low = mid + 1;
    } else {
      high = mid;
    }
  }
  return [...users.slice(0, low), newUser, ...users.slice(low)];
};